package nl.hanze.designpatterns.mvc.view;

import java.awt.BorderLayout;

import nl.hanze.designpatterns.mvc.controller.LoginController;
import nl.hanze.designpatterns.mvc.model.MainModel;

public class LoginGui extends Gui{
	
		/**
		 * 
	 	*/
		private static final long serialVersionUID = 1L;
		private LoginView loginView;
		private LoginController loginController;
		private MainModel model;
		
		
		public LoginGui(MainModel model){
			this.init(model);
			this.addComponents();	
			this.setVisible(true);
		}
		
		private void init(MainModel model){
			this.model = model;
			this.setLoginController(new LoginController(this));
			this.loginView = new LoginView(this.getLoginController());
			
			this.setTitle("Design Patterns");
			this.setSize(300, 200);
			this.setResizable(false);
			this.setLocationRelativeTo(null);
			this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		}
		
		private void addComponents(){
			this.add(loginView, BorderLayout.CENTER);
		}

		public LoginController getLoginController() {
			return this.loginController;
		}
		
		public LoginView getView(){
			return this.loginView;
		}

		public void setLoginController(LoginController loginController) {
			this.loginController = loginController;
		}

		public MainModel getModel() {
			return model;
		}

		public void setModel(MainModel model) {
			this.model = model;
		}		
}
